<template >

  <div class="bg-f5f5f5" style="height:100%;">
      <div style="width:100%;height:188px;background:#5fcadc;">
      <div class="home-bar page-bar ">
        
                      <mt-header title="">
                      <mt-button @click="goback()"  slot="left">
                          <mt-button icon="back"></mt-button>
                                </mt-button>
                    
                      </mt-header>
                  

                   <div style="height:132px;padding:0 12px;">
                      <div class="position-relative" >
                              <div  class="display-inline-block position-relative overflow-hidden" style="width:30%;height:132px;">
                                  <img class=" position-absolute " :src='routerParams.photo_url!=""?homeListDoctorArr1Img+routerParams.photo_url:homeListDoctorSpare'  :onerror="SpareImg()" style="width:82px;margin:auto;left:0;right:0;top:10px;">
                              </div>

                               <div class="display-inline-block position-relative"   style="width:68%;height:132px;">
                                  <div class=" position-absolute ">
                                   <div style="height:16px;"></div>
                                  <div    class="font-size-15 color-ffffff">{{routerParams.name}}</div>
                                  <div  class="font-size-15 color-ffffff">{{routerParams.sex=='1'?'男':'女'}}{{routerParams.tel==''?'':'&nbsp;&nbsp;&nbsp;电话:'+routerParams.tel}}</div>
                                  <div style="height:5px;"></div>
                                  <div  style="width:100%;height:1px;background:#ffffff;"></div>
                                  <div style="height:5px;"></div>
                                  <div  class="font-size-10 color-ffffff">{{routerParams.position==''?'暂无职称信息':routerParams.position}}</div>
                                  
                               </div>       
                               </div>


                                
                      </div>
                      
                   </div>
            
                  </div>
                  
                  </div>
                    
                     <div class="" style="padding:0 12px;z-index:-1;">
                    <div style="height:16px;"></div>
                                
                                <div class="color-666666 font-size-15 text-indent-2em" stlye="line-height:24px;">{{routerParams.jj==''?'':routerParams.jj}}
                                {{routerParams.resume==''?'暂无详情信息':routerParams.resume}}
                                 <div style="height:46px;"></div>
                                </div>
                                <!--<div v-if="routerParams.name=='吴东彦'" class="color-666666 font-size-15" stlye="line-height:24px;" >
                                  <div>职务：团队队员 </div>
                                  <div>职责：健康教育 </div>
                                  <div>职称：药师 </div>
                                  <div>简介：毕业于江西中医药大学科技学院 现就职于城管社区卫生服务中心。</div>
                                  <div>电话:18795030668 </div>
                                  </div>

                                  <div v-if="routerParams.name=='闻唐山'" class="color-666666 font-size-15" stlye="line-height:24px;" >
                               <div>职务：团队队员 </div>
                                <div>职责：执业医师 </div>
                                <div>职称：全科医生、健康管理师 </div>
                                <div>简介：毕业于宁夏医科大学临床本科专业，擅长影像技术、康复技术、疼痛治疗等。</div>
                                <div>电话:15769667689 </div>
                                  </div>


                              <div v-if="routerParams.name=='刘贵文'" class="color-666666 font-size-15" stlye="line-height:24px;" >
                                <div>职称：外科主治医师，专科学历。团队指导医师 </div>
                                <div>简介：于1977年毕业于河北新医大学医疗专业，从事医疗工作50余年，擅长外科手术。</div>
                                <div>电话:13995135336 </div>
                              </div>

                             
                                  <div v-if="routerParams.name=='候杨娜'" class="color-666666 font-size-15" stlye="line-height:24px;" >
                                  暂无信息
                                  </div>


                                   <div v-if="routerParams.name=='徐向宏'" class="color-666666 font-size-15" stlye="line-height:24px;" >
                                
                                    <div>职责：团队长 </div>
                                    
                                    <div>简介：毕业于国家开放大学，从事国家基本公共卫生健康管理工作。</div>
                                    <div>电话:18809532002  </div>
                                  </div>-->
                                 
                   </div>
                   
                       <div  class="position-fixed width100" style="height:46px;background:#ddd;bottom:0;z-index:3;">
                        <div @click="Answer()" class="display-inline-block text-align-center color-ffffff" style="width:50%;height:46px;float:left;line-height:40px;">
                            答题
                        </div>
                        <div @click="stateGohomeDetailsDialogBox()" class="display-inline-block text-align-center color-ffffff" style="width:50%;height:46px;float:right;background:#5fcadc;line-height:40px;">
                            在线咨询
                        </div>
                      </div>
        
  </div>
  
</template>

<script>


import { Header } from 'mint-ui';
import Vue from 'vue';
import config from '../config/config.js';
Vue.component(Header.name, Header);


export default {
  name: 'homeDetails',
  data () {
    return {
      msg: 'home-details',
      routerParams:'',//上一级router 传的值
    
      //医生的信息
      doctorVal:'',
      doctorImg:'',
      //医生列表 图片前缀
     
     homeListDoctorArr1Img:config.ObtainDoctorListDoctorImgSplicing,
     //备用医生头像
     homeListDoctorSpare:require('../assets/yisheng.png'),
     

    
      
    }
  },
  beforeUpdate(){
    console.log('test')
    //config.scrollTopFunName();     
    
  },
  //销毁完成状态
   destroyed(){
     config.scrollTopFunName(); 
   
   },
    created(){
        
       
         // 取到路由带过来的参数  
       
            //    let routerParams = this.$route.params.itemObj;
            //         console.log(this.$route.params.itemObj.address);
            //         console.log(routerParams);
            //         console.log('233');
                    if(this.$route.params.itemObj){

                        this.start();
                   
                                        
                      
       
                    }else{
                       this.routerParams=JSON.parse(sessionStorage.getItem("homeDetailsVal"));
                       console.log(this.routerParams)
                             //医生信息
                      this.doctorVal={
                          name:this.routerParams.name,
                          title:this.routerParams.title,
                          
                      }
                    


                      
                     }
       
  },
  //载入后
  mounted(){
        
        
  },
   methods:{
     //start
     start(){
             this.routerParams=this.$route.params.itemObj;
                    console.log(this.routerParams)

                     window.sessionStorage.setItem("homeDetailsVal",JSON.stringify(this.routerParams))
                      //医生信息
                      this.doctorVal={
                          name:this.routerParams.name,
                          title:this.routerParams.title,
                          
                      }


                      //头像 
                    //   if(this.routerParams.name=='吴东彦'){
                    //         this.doctorImg=require('../assets/wudongyan.png');
                    //     }
                    //     else if(this.routerParams.name=='闻唐山'){
                    //         this.doctorImg=require('../assets/wentangshan.png'); 
                    //     }
                    //     else if(this.routerParams.name=='刘贵文'){
                    //         this.doctorImg=require('../assets/liuguiwen.png');
                    //     }
                    //     else if(this.routerParams.name=='候杨娜'){
                    //         this.doctorImg=require('../assets/houyangna.png');
                    //     }
                    //     else if(this.routerParams.name=='徐向宏'){
                    //         this.doctorImg=require('../assets/xuxianghong.png');
                    //     }else{
                    //         this.doctorImg==require('../assets/yisheng1.png'); 
                    //     }

                        
     },
      
      login(){
          this.$router.push({ path: '/HelloWorld' });
      },
      goback(){
          //this.$router.go(-1);
          this.$router.back(-1)
      },
      Answer(){
          window.location.href="http://dt.cpcs.top/";
      },
      //homeDetailsDialogBox
      stateGohomeDetailsDialogBox(){
                     //清除 新消息标记储存
                     sessionStorage.removeItem('NewNewsArrSessionStorageSign');
                     
                
                //  if(config.isIosPlatform==false){
                //     //安卓
                 
                      this.$router.push({ path: '/homeDetailsDialogBox',name:'homeDetailsDialogBox',params:{itemObj:JSON.parse(sessionStorage.getItem("homeDetailsVal"))
                      }});
                    //   this.$router.replace({ path: '/homeDetailsDialogBox',name:'homeDetailsDialogBox',params:{itemObj:JSON.parse(sessionStorage.getItem("homeDetailsVal"))
                    //   }});

                // }else{
                //     //ios
                //       this.$router.replace({ path: '/homeDetailsDialogBox',name:'homeDetailsDialogBox',params:{itemObj:JSON.parse(sessionStorage.getItem("homeDetailsVal"))
                //      }});
                  
                // }

        
      },
       SpareImg(){
          return 'this.src="' + require('../assets/yisheng.png') + '"';
          
      },

     
   }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
   .mint-header{
  height:56px;
  background:rgba(0,0,0,0) !important;
   
}
template{
    overflow-y:hidden;
}
</style>
